<template>
    <div>

        <h1 :style="styleCss"> {{ msg }} </h1>

    </div>
</template>

<script>
export default {
    name: 'HelloLife',
    data() {
        return {
            msg: 'Welcome to Your Vue.js App',
            styleCss: {
                opacity: 1
            }
        }
    },
    mounted() {
        // 挂载完成
        console.log('Component mounted.', this)
        setInterval(() => {
            this.styleCss.opacity -= 0.01
            if (this.styleCss.opacity <= 0) {
                this.styleCss.opacity = 1
            }
        }, 16)
    }
}
</script>

